package bat.ke.qq.com.select;

import org.apache.ibatis.annotations.Select;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MapperProxyFactory  implements InvocationHandler {
  @Override
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    //获取sql的语句 然后就去执行 具体业务代码 mybatis ：selectOne
    Select annotation = method.getAnnotation(Select.class);
    String sql= annotation.value()[0];
    System.out.println("sql："+sql+"    args："+args[0]);
    //JDBC代码 工具
    return null;
  }
}
